﻿@using Apps.Web.Core;
@using Apps.Web;
@using Apps.Common;
@using Apps.Models.Sys;
@using Apps.Locale;
@using Wantn.FIS.Enum
@{
    ViewBag.Title = "化验原始结果";
    Layout = "~/Views/Shared/_Index_Layout.cshtml";
    List<permModel> perm = null;
}
<div class="mvctool bgb">
    <input id="txtTestCode" class="condition-testcode" placeholder="化验号" type="text" />
    <select id="queryState" name="queryState">
        <option value="0">==审批状态==</option>
        <option value="1">未审核</option>
        <option value="2">无需审核</option>
        <option value="3">已审核</option>
    </select>
    @Html.ToolButton("btnQueryParent", "fa fa-search", Resource.Query, ref perm, "Query", true)
</div>

<table border="0" style="width:100%">
    <tr><td><table id="ListParent"></table></td></tr>
</table>

<div id="modalwindow" class="easyui-window" style="width:800px; height:400px;" data-options="modal:true,closed:true,minimizable:false,shadow:false"></div>
<script type="text/javascript">
    $(function () {

        $('#ListParent').datagrid({
            url: '@Url.Action("GetList")',
            //width: SetGridWidthSub(40),
            methord: 'post',
            height: SetGridHeightSub(45),
            fitColumns: true,
            sortName: 'UPDATE_TIME',
            sortOrder: 'desc',
            idField: 'TEST_CODE',
            pageSize: 15,
            pageList: [15, 20, 30, 40, 50],
            pagination: true,
            striped: true, //奇偶行是否区分
            singleSelect: true,//单选模式
            checkOnSelect: false,
            selectOnCheck: false,
            rownumbers: true,//行号
            onLoadSuccess: function (data) {
            },
            columns: [[
                { field: 'TEST_CODE', title: '化验编码', width: 120, sortable: true },
                { field: 'UPDATE_TIME', title: '化验时间', width: 120, sortable: true },
                { field: 'MT', title: '全水分<br>Mt(%)', width: 80 },
                { field: 'MAD', title: '空气干燥基水分<br>Mad(%)', width: 80 },
                { field: 'AAD', title: '空气干燥基灰分<br>Aad(%)', width: 80 },
                { field: 'AD', title: '干燥基灰分<br>Ad(%)', width: 80 },
                { field: 'VAD', title: '空气干燥基挥发分<br>Vad(%)', width: 80 },
                { field: 'VDAF', title: '干燥无灰基挥发分<br>Vdaf(%)', width: 80 },
                { field: 'STAD', title: '空气干燥基硫<br>St,ad(%)', width: 80 },
                { field: 'STD', title: '干燥基硫<br>St,d(%)', width: 80 },
                { field: 'QBAD', title: '弹筒发热量<br>Qb,ad(%)', width: 80 },
                { field: 'QNETAR_KCAL', title: '收到基低位发热值<br>Qnet,ar/kal(Kcal/kg)', width: 80 },
                { field: 'G', title: '粘结指数<br>G', width: 80 },
                { field: 'Y', title: '胶质最大角质层厚度<br>Y', width: 80 },
                { field: 'X', title: '胶质最大收缩度<br>X', width: 80 },
                { field: 'A', title: '奥亚最大收缩度<br>a', width: 80 },
                { field: 'B', title: '奥亚最大膨胀度<br>b', width: 80 },
                { field: 'TEST_STATE_STR', title: '审批状态', width: 80, sortable: true, formatter: @Html.Raw(GridHelper.GridFormatterFunc<ApprovalStatus>("gConvertApprovalStatus")) },
                { field: 'AUDIT_STATE', hidden: true, title: '审批结果', width: 160 },
                { field: 'AUDIT_REMARK', hidden: true, title: '审批备注', width: 160 }
            ]]
        });
    });

    //ifram 返回
    function frameReturnByClose() {
        $("#modalwindow").window('close');
    }
    function frameReturnByReload(flag) {
        if (flag)
            $("#ListParent").datagrid('load');
        else
            $("#ListParent").datagrid('reload');
    }
    function frameReturnByMes(mes) {
        $.messageBox5s(Lang.Tip, mes);
    }
    $(function () {
        $("#btnQueryParent").click(function () {
            $("#ListParent").datagrid("load", {
                testCode: $("#txtTestCode").val(),
                queryState: $("#queryState").val(),
                TYPE_STR: $("#TYPE_ID").combobox('getValues').toString(),
            });
        });
    });
</script>
